import { post } from '@/utils/request'

// 获取角色分页列表
export const getPageList = p => post(`/service-upms/b/role/v1/pageList`, p)

// 获取角色列表
export const getRoleList = p => post(`/service-upms/b/role/v1/selectRoleList`, p, 'get')

// 获取角色列表
export const listAllRoles = p => post(`/service-upms/b/role/v1/list`, p)

// 新增角色
export const addRole = p => post(`/service-upms/b/role/v1/add`, p)

// 编辑角色
export const modifyRole = p => post(`/service-upms/b/role/v1/modify`, p)

// 通过ID获取角色信息
export const getRoleById = p => post(`/service-upms/b/role/v1/view/${p}`, {}, 'get')

// 修改状态
export const updateState = p => post(`/service-upms/b/role/v1/changeStatus/${p.id}/${p.status}`, p, 'get')

// 通过ID删除角色
export const delRoleById = p => post(`/service-upms/b/role/v1/del/${p.id}`, {}, 'get')

// 查询角色拥有权限id列表
export const getAuthorityById = p => post(`/service-upms/b/role/v1/queryPermissionIdsByRoleId/${p.id}`, {}, 'get')

// 查询角色拥有用户id列表
export const getUserInfoByRoleId = p => post(`/service-upms/b/role/v1/queryUserIdsByRoleId/${p}`, p, 'get')

// 角色关联权限
export const modifyByRoleId = p => post(`/service-upms/b/rolePermission/v1/modifyByRoleId`, p)
// 角色关联用户权限
export const userModifyByRoleId = p => post(`/service-upms/b/userRole/v1/modifyByRoleId`, p)

// 角色设置——用户关联
export const userPageList = p => post(`/service-upms/b/user/v1/pageList`, p)

